﻿/********************************************************
 * 类名：SetManageHandler.cs
 * 功能：
 *   ver	变更日		作者			变更内容
 * ────────────────────────────────────────
 *   V01.0	2013-11-27	李波			初版
 *
 * Copyright (c) 2013，李波版权所有
 ********************************************************/
using System;
using System.Web;
using PSS.BLL.SetManage.AuxiliaryInfo;
using PSS.BLL.SetManage.BasicData;
using PSS.Entity;
using PSS.Entity.SetManage.BasicData;
using PSS.Utility;

namespace PSS.WebSite.Service
{
    /// <summary>
    /// SetManageHandler 的摘要说明
    /// </summary>
    public class SetManageHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            try
            {
                var action = StrRequest.GetQueryString("action");
                if (string.IsNullOrEmpty(action)) return;
                var method = this.GetType().GetMethod(action);
                if (method == null) return;
                object[] parameters = { context };
                method.Invoke(this, parameters);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("程序错误：" + ex.Message);
            }
        }

        #region 设置

        #region 客户类别
        public void GetCustomerCategoryList(HttpContext context)
        {
            try
            {
                var bll = new CustomerCategoryBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetCustomerCategoryList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetCustomerCategoryInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["CCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new CustomerCategoryBLL().GetCustomerCategoryInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetCustomerCategoryListByCombobox(HttpContext context)
        {
            try
            {
                var json = new CustomerCategoryBLL().GetCustomerCategoryListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyCustomerCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new CustomerCategoryBLL().ModifyCustomerCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddCustomerCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new CustomerCategoryBLL().AddCustomerCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveCustomerCategory(HttpContext context)
        {
            try
            {
                var id = context.Request["CCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new CustomerCategoryBLL().RemoveCustomerCategory(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 供应商类别
        public void GetVendorCategoryList(HttpContext context)
        {
            try
            {
                var bll = new VendorCategoryBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetVendorCategoryList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetVendorCategoryInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["VCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new VendorCategoryBLL().GetVendorCategoryInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetVendorCategoryListByCombobox(HttpContext context)
        {
            try
            {
                var json = new VendorCategoryBLL().GetVendorCategoryListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyVendorCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new VendorCategoryBLL().ModifyVendorCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddVendorCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new VendorCategoryBLL().AddVendorCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveVendorCategory(HttpContext context)
        {
            try
            {
                var id = context.Request["VCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new VendorCategoryBLL().RemoveVendorCategory(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 商品类别
        public void GetGoodsCategoryList(HttpContext context)
        {
            try
            {
                var bll = new GoodsCategoryBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetGoodsCategoryList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetGoodsCategoryInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["GCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new GoodsCategoryBLL().GetGoodsCategoryInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetGoodsCategoryListByCombobox(HttpContext context)
        {
            try
            {
                var json = new GoodsCategoryBLL().GetGoodsCategoryListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyGoodsCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new GoodsCategoryBLL().ModifyGoodsCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddGoodsCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new GoodsCategoryBLL().AddGoodsCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveGoodsCategory(HttpContext context)
        {
            try
            {
                var id = context.Request["GCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new GoodsCategoryBLL().RemoveGoodsCategory(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 计量单位
        public void GetUnitList(HttpContext context)
        {
            try
            {
                var bll = new UnitBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetUnitList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetUnitInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["UnitId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new UnitBLL().GetUnitInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetUnitListByCombobox(HttpContext context)
        {
            try
            {
                var json = new UnitBLL().GetUnitListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyUnit(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new UnitBLL().ModifyUnit(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddUnit(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new UnitBLL().AddUnit(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveUnit(HttpContext context)
        {
            try
            {
                var id = context.Request["UnitId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new UnitBLL().RemoveUnit(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 结算方式
        public void GetSettlementCategoryList(HttpContext context)
        {
            try
            {
                var bll = new SettlementCategoryBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetSettlementCategoryList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetSettlementCategoryInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["SCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new SettlementCategoryBLL().GetSettlementCategoryInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetSettlementCategoryListByCombobox(HttpContext context)
        {
            try
            {
                var json = new SettlementCategoryBLL().GetSettlementCategoryListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifySettlementCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new SettlementCategoryBLL().ModifySettlementCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddSettlementCategory(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new SettlementCategoryBLL().AddSettlementCategory(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveSettlementCategory(HttpContext context)
        {
            try
            {
                var id = context.Request["SCategoryId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new SettlementCategoryBLL().RemoveSettlementCategory(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 客户管理
        public void GetCustomerList(HttpContext context)
        {
            try
            {
                var bll = new CustomerBLL();
                var qcmodel = new CustomerQcEntity
                {
                    CCategoryId = context.Request["CCategoryId"],
                    CustomerCode = context.Request["CustomerCode"],
                    CustomerName = context.Request["CustomerName"],
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetCustomerList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetCustomerInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["CustomerId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new CustomerBLL().GetCustomerInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddCustomer(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new CustomerBLL().AddCustomer(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyCustomer(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new CustomerBLL().ModifyCustomer(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetCustomerContactsList(HttpContext context)
        {
            try
            {
                var bll = new CustomerBLL();
                var qcmodel = new CustomerContactsQcEntity
                {
                    CustomerId = context.Request["CustomerId"]
                };
                var json = bll.GetCustomerContactsList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveCustomer(HttpContext context)
        {
            try
            {
                var id = context.Request["CustomerId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new CustomerBLL().RemoveCustomer(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetCustomerListByCombobox(HttpContext context)
        {
            try
            {
                var json = new CustomerBLL().GetCustomerListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 供应商管理
        public void GetVendorList(HttpContext context)
        {
            try
            {
                var bll = new VendorBLL();
                var qcmodel = new VendorQcEntity
                {
                    VCategoryId = context.Request["VCategoryId"],
                    VendorCode = context.Request["VendorCode"],
                    VendorName = context.Request["VendorName"],
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetVendorList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetVendorInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["VendorId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new VendorBLL().GetVendorInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetVendorListByCombobox(HttpContext context)
        {
            try
            {
                var json = new VendorBLL().GetVendorListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddVendor(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new VendorBLL().AddVendor(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyVendor(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new VendorBLL().ModifyVendor(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetVendorContactsList(HttpContext context)
        {
            try
            {
                var bll = new VendorBLL();
                var qcmodel = new VendorContactsQcEntity
                {
                    VendorId = context.Request["VendorId"]
                };
                var json = bll.GetVendorContactsList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveVendor(HttpContext context)
        {
            try
            {
                var id = context.Request["VendorId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new VendorBLL().RemoveVendor(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 仓库管理
        public void GetStorageList(HttpContext context)
        {
            try
            {
                var bll = new StorageBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetStorageList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetStorageInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["StorageId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new StorageBLL().GetStorageInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetStorageListByCombobox(HttpContext context)
        {
            try
            {
                var json = new StorageBLL().GetStorageListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyStorage(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new StorageBLL().ModifyStorage(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddStorage(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new StorageBLL().AddStorage(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveStorage(HttpContext context)
        {
            try
            {
                var id = context.Request["StorageId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new StorageBLL().RemoveStorage(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 商品管理
        public void GetGoodsList(HttpContext context)
        {
            try
            {
                var bll = new GoodsBLL();
                var qcmodel = new GoodsQcEntity
                {
                    GoodsCode = context.Request["GoodsCode"],
                    GoodsName = context.Request["GoodsName"],
                    GCategoryId = context.Request["GCategoryId"],
                    Specific = context.Request["Specific"],
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetGoodsList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetGoodsInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["GoodsId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new GoodsBLL().GetGoodsInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddGoods(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new GoodsBLL().AddGoods(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyGoods(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new GoodsBLL().ModifyGoods(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetGoodsDetailList(HttpContext context)
        {
            try
            {
                var bll = new GoodsBLL();
                var qcmodel = new GoodsDetailQcEntity
                {
                    GoodsId = context.Request["GoodsId"]
                };
                var json = bll.GetGoodsDetailList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveGoods(HttpContext context)
        {
            try
            {
                var id = context.Request["GoodsId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new GoodsBLL().RemoveGoods(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #region 账户管理
        public void GetAccountList(HttpContext context)
        {
            try
            {
                var bll = new AccountBLL();
                var qcmodel = new Pagination
                {
                    PageIndex = Convert.ToInt32(context.Request["pageIndex"]),
                    PageSize = Convert.ToInt32(context.Request["pageSize"]),
                    SortField = context.Request["sortField"],
                    SortOrder = context.Request["sortOrder"]
                };
                var json = bll.GetAccountList(qcmodel);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetAccountInfo(HttpContext context)
        {
            try
            {
                var id = context.Request["AccountId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new AccountBLL().GetAccountInfo(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void GetAccountListByCombobox(HttpContext context)
        {
            try
            {
                var json = new AccountBLL().GetAccountListByCombobox();
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void ModifyAccount(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new AccountBLL().ModifyAccount(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void AddAccount(HttpContext context)
        {
            try
            {
                var data = context.Request["data"];
                new AccountBLL().AddAccount(data);
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        public void RemoveAccount(HttpContext context)
        {
            try
            {
                var id = context.Request["AccountId"];
                if (string.IsNullOrEmpty(id)) return;
                var json = new AccountBLL().RemoveAccount(id);
                context.Response.Write(json);
                context.Response.End();
            }
            catch (Exception ex)
            {
                EventsLog.WriteLog("ErrorInfo" + ex.Message);
            }
        }
        #endregion

        #endregion

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}